Testing Hints and Samples

For reefer XML webservices, the handler name is ReeferMonitoringWebServiceHandlerImpl. Based on this name, following are very simple example groovy snippets that when deployed will be called by N4. The way to verify that they get called is to deploy each of the with exactly the name that they have and invoke XML Reefer Api feature using Argo Service Tester. The invocation (from Argo Tester) should lead to log messages written in the following groovy snippets.
Initially I recommend to use just the simple groovy below.

 

ReeferMonitoringWebServiceHandlerImplPreInvoke.groovy

import java.util.Map;

import com.Navis.apex.business.model.GroovyInjectionBase;

class ReeferMonitoringWebServiceHandlerImplPreInvoke extends GroovyInjectionBase {

  public String transform(String inXml) {

  log("transform method got called");

    return inXml;

  }

}

 

ReeferMonitoringWebServiceHandlerImplPostInvoke.groovy

import java.util.Map;

import com.Navis.apex.business.model.GroovyInjectionBase;

class ReeferMonitoringWebServiceHandlerImplPostInvoke extends GroovyInjectionBase {

  /**

   * This method is called just after invoking the N4 generic webservices handler.

   * @param inParameters contains the handler that is called.

   */

  public void postHandlerInvoke(Map inParameters) {

    log("postHandlerInvoke (no tx) got called with :" + inParameters);

  }

}

 

ReeferMonitoringWebServiceHandlerImplPreInvokeInTx.groovy

import java.util.Map;

import com.Navis.apex.business.model.GroovyInjectionBase;

class ReeferMonitoringWebServiceHandlerImplPreInvokeInTx extends GroovyInjectionBase {

  /**

   * This method is called just before invoking the N4 generic webservices handler.

   * @param inParameters contains the handler that is called.

   */

  public void preHandlerInvoke(Map inParameters) {

    log("preHandlerInvoke got called with :" + inParameters);

  }

}

 

ReeferMonitoringWebServiceHandlerImplPostInvokeInTx.groovy

import java.util.Map;

import com.Navis.apex.business.model.GroovyInjectionBase;

class ReeferMonitoringWebServiceHandlerImplPostInvokeInTx extends GroovyInjectionBase {

  /**

   * This method is called just after invoking the N4 generic webservices handler.

   * @param inParameters contains the handler that is called.

   */

  public void postHandlerInvoke(Map inParameters) {

    log("postHandlerInvoke got called with :" + inParameters);

  }

}